using Sandia.MVCFramework.Common;
using Sandia.MVCFramework.DataAccessor;
using Sandia.MVCFramework.DataAnalyzer;
using Sandia.MVCFramework.DataStore;
using Sandia.MVCFramework.Request;
using Sandia.MVCFramework.View;
using Sandia.MVCFramework.ViewManager;
using System;
using System.Collections.Generic;
using System.Text;
using Sandia.MVCFramework.ExportTools;

namespace Sandia.MVCFramework.Plugin
{
    /// <summary>
    /// Interface to be implemented by classes that act
    /// as plugins
    /// </summary>
    public interface IPlugin 
        : IStartable, IRequestProcessor, IDataPacketProducer
    {
        /// <summary>
        /// Initialize the plugin
        /// </summary>
        /// <param name="requestRouter">The request router to be used by the plugin</param>
        /// <param name="publisher">The publisher to be used by the plugin</param>
        void Init(IRequestRouter requestRouter, IPublisher publisher);

        /// <summary>
        /// The unique ID for this plugin.
        /// </summary>
        string ID
        {
            get;
        }

        /// <summary>
        /// The display name for this plugin.
        /// </summary>
        string DisplayName
        {
            get;
        }

        /// <summary>
        /// The plugin loader version this plugin is writen to
        /// </summary>
        long LoaderVersionToUse
        {
            get;
        }

        /// <summary>
        /// A list of plugin Ids that this plugin is dependant on.
        /// </summary>
        List<string> Dependencies
        {
            get;
        }

        /// <summary>
        /// DataAccessors provided by the plugin
        /// </summary>
        List<IDataAccessor> DataAccessors
        {
            get;
        }

        /// <summary>
        /// DataAnalyzers provided by the plugin
        /// </summary>
        List<IDataAnalyzer> DataAnalyzers
        {
            get;
        }

        /// <summary>
        /// DataStores provided by the plugin
        /// </summary>
        List<IDataStore> DataStores
        {
            get;
        }

        /// <summary>
        /// ControllerActions provided by the plugin
        /// </summary>
        Dictionary<Type, List<IRequestProcessor>> RequestRoutings
        {
            get;
        }

        /// <summary>
        /// Subscriptions provided by the plugin.
        /// </summary>
        Dictionary<Type, List<ISubscriber>> Subscriptions
        {
            get;
        }

        /// <summary>
        /// ViewManagers provided by the plugin
        /// </summary>
        List<IViewManager> ViewManagers
        {
            get;
        }

        /// <summary>
        /// Exporters provided by the plugin.
        /// </summary>
        List<IExporter> Exporters
        {
            get;
        }

        /// <summary>
        /// Importers provided by the plugin.
        /// </summary>
        List<IImporter> Importers
        {
            get;
        }
    }
}
